local skel = fk.CreateSkill {
  name = "lb__hongze",
}

Fk:loadTranslationTable {
  ["lb__hongze"] = "虹泽",
  --[":lb__hongze"] = "当你回复体力后，你可以令任意名已横置的其他角色各摸一张牌。",
  --["#lb__hongze"] = "虹泽：你可以令任意名已横置的其他角色各摸一张牌",
  --9.18
  --[":lb__hongze"] = "当你回复体力后，你可以令任意名已横置的其他角色各摸一张牌，然后你可以复原其中任意名角色的武将牌。",
  --9.20
  --[":lb__hongze"] = "当你回复体力后，你可以令任意名横置角色各摸一张牌，然后你可以复原其中任意名角色的武将牌。",
  --10.5
  [":lb__hongze"] = "当你回复体力后，你可以令任意名横置角色各摸一张牌并复原武将牌。",

  --["#lb__hongze"] = "虹泽：你可以令任意名已横置的其他角色各摸一张牌，然后你可以复原其中任意名角色的武将牌",
  --["#lb__hongze"] = "虹泽：你可以令任意名横置角色各摸一张牌，然后你可以复原其中任意名角色的武将牌",
  ["#lb__hongze"] = "虹泽：你可以令任意名横置角色各摸一张牌并复原武将牌",
  ["#lb__hongze_ask"] = "虹泽：你可以复原任意名角色的武将牌",

  ["$lb__hongze1"] = "未来，一定是光明的。",
  ["$lb__hongze2"] = "愿这一抹微光，拨开阴翳与迷雾。",
}

skel:addEffect(fk.HpRecover, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and target == player
        and table.find(player.room:getAlivePlayers(), function(t)
          return t.chained
        end)
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local tos = table.filter(room:getAlivePlayers(), function(t)
      return t.chained
    end)
    if #tos == 0 then return end
    tos = room:askToChoosePlayers(player, {
      targets = tos,
      min_num = 1,
      max_num = 999,
      skill_name = skel.name,
      cancelable = true,
      prompt = "#lb__hongze",
    })
    room:sortByAction(tos)
    event:setCostData(self, { tos = tos })
    return #tos > 0
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local tos = event:getCostData(self).tos
    for _, t in ipairs(tos) do
      if not t.dead then
        t:drawCards(1, skel.name)
        t:reset()
      end
    end
    --[[
    tos = table.filter(tos, function (to)
      return not to.dead
    end)
    if #tos > 0 and not player.dead then
      tos = room:askToChoosePlayers(player, {
        targets = tos,
        min_num = 1,
        max_num = 999,
        skill_name = skel.name,
        cancelable = true,
        prompt = "#lb__hongze_ask",
      })
      if #tos > 0 then
        room:sortByAction(tos)
        for _, t in ipairs(tos) do
          if not t.dead then
            t:reset()
          end
        end
      end
    end
    --]]
  end,
})

return skel
